// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import router from './router'
import store from './store'
import devCof from '@/conf/dev.conf.js'
import marked from 'marked'
import 'vue2-animate/dist/vue2-animate.min.css'

Vue.config.productionTip = false
/* eslint-disable no-new */
// 把md放到vue原型链上
// let rendererMD = new marked.Renderer()
// marked.setOptions({
//   renderer: rendererMD,
//   gfm: true,
//   tables: true,
//   breaks: false,
//   pedantic: false,
//   sanitize: false,
//   smartLists: true,
//   smartypants: false
// })
Vue.prototype.marked = marked
new Vue({
  el: '#app',
  router,
  store,
  methods: {
    RightM () {
      // alert('嘿嘿')
    }
  },
  created () {
    // 页面加载后监听不允许使用F12
    // let ListenF12 = 0
    document.onkeydown = function (e) {
      if (e.key === 'F12') {
        // alert('恭喜你年轻人！你找到了王的宝藏...')
        // return false
        // ListenF12++
        // console.log(ListenF12)
      }
      // if (ListenF12 > 5) {
      //   alert('点你妹')
      // }
    }
    document.addEventListener('visibilitychange', function () {
      if (document.visibilityState === 'hidden') {
        document.title = devCof.leaveTitle
      } else {
        document.title = devCof.backTitle
        setTimeout(function () {
          document.title = devCof.defaultTitle
        }, 3000)
      }
    }, false)
  }
})
